Resource sharing with database synchronization

ABSTRACT

A system uses a resource locking token to allow various processes to have exclusive access to a system resource. The process that receives the token then requests that a local database be updated/synchronized with a master database. The process continues checking the synchronization status every time it gets the token. When the process receives the token and the synchronization is complete, the local database is accessed and the data is used in accessing the system resource. The token is then returned to the system.

TECHNICAL FIELD

[0001] The present invention relates generally to the sharing of systemresources.

BACKGROUND

[0002] System resources, such as printers, processors, modems, memory,and even other applications, may be shared amongst various systemapplications/processes. For example, a communication process may share amodem resource with an email process.

[0003] However, typically only one system process can access theresource at any one time. If a lower priority process is using a systemresource, other higher priority processes are locked out until the lowerpriority process has relinquished control.

[0004] Systems that employ databases can have one master copy of theinformation contained in the database and multiple “local” copies. Thelocal copies may be exact copies of the master database information orthe local copies may be a subset of the information that is stored inthe master database.

[0005] In order for the local databases to have the most up-to-dateinformation from the master database, the local databases must beperiodically synchronized with the master database. For example, if themaster database is updated with new information, the local databasestypically will not have this-new information until the databases aresynchronized.

[0006] One problem with synchronizing databases in a system is that alower priority process may have a system resource locked while waitingfor a local database to synchronize. While the lower priority processhas the system resource locked, higher priority processes cannot use theresource. There is a resulting need in the art for a prioritized systemthat enables system processes having different priority levels to sharea system resource.

SUMMARY OF THE INVENTION

[0007] The embodiments of the present invention encompass resourcesharing and database synchronization. The method first receivesexclusive access to the resource. Synchronization of a local databasewith a master database is then requested. The method then checks thesynchronization status until synchronization is complete. Data from thelocal database is then read and the shared resource is accessed with thedata. The exclusive access to the resource is then returned to thecontrolling system for distribution to other processes.

BRIEF DESCRIPTION OF THE DRAWINGS

[0008]FIG. 1 shows a block diagram of one embodiment of a distributeddatabase system of the present invention.

[0009]FIG. 2 shows a flow diagram of one embodiment of a resourcesharing system of the present invention.

[0010]FIG. 3 shows a state diagram of one embodiment of a resourcesharing and database synchronization method of the present invention.

[0011]FIG. 4 shows a flowchart of one embodiment of a backgroundsynchronization method of the present invention.

[0012]FIG. 5 shows a block diagram of one embodiment of a system of thepresent invention.

[0013]FIG. 6 shows a block diagram of one embodiment of a managementcard of the present invention.

[0014]FIG. 7 shows a block diagram of one embodiment of a line card ofthe present invention.

DETAILED DESCRIPTION

[0015] The embodiments of the resource sharing with databasesynchronization of the present invention provide prioritized access to ashared system resource. Additionally, a low priority process does notlock out other higher priority processes from the resource while waitingfor a local database to be synchronized.

[0016] Subsequent discussions of the various databases of theembodiments of the present invention refer to synchronization of thedatabases. Synchronization and updating of the databases are consideredto be substantially similar tasks and the terms can be usedinterchangeably.

[0017]FIG. 1 illustrates a block diagram of one embodiment of adistributed database system of the present invention. The masterdatabase (101) stores information/data for later retrieval. In oneembodiment, the master database (101) stores statistics regarding aquality of service provided over a communication line (e.g., a digitalsubscriber line (DSL)).

[0018] Each statistic in the database may be referred to as an object orelement. For example, in one embodiment, if the data stored in thedatabase includes statistics on the quality of service of acommunication link, one object stored in the database is a bit errorrate for each link that is coupled to the master database. Other typesof objects/elements include link downtime, link bit rate, and subscriberinformation.

[0019] In alternate embodiments, the database is used for storinginformation that is not related to communication link quality ofservice. In such embodiments, the objects/elements are not communicationlink related. The types of objects/elements stored in the database donot limit the present invention.

[0020] The master database (101) is coupled to multiple local databases(105-106). The embodiment of FIG. 1 illustrates these databases as localdatabase 1 (105) through local database N (106). The databases may be ofany size.

[0021] The local databases (105-106), in one embodiment, have thecapacity to hold a substantially equivalent copy of the data that isstored in the master database (101). In another embodiment, the memorycapacity of the local databases (105-106) is such that only a smallersubset of the data stored in the master database (101) will fit in thelocal databases.

[0022] The databases (101, 105, and 106) of the present invention arestored in some form of memory. In one embodiment, the database memory isof the type used for temporary storage of data such as random accessmemory (RAM). The database memory may also be of the type used forpermanent storage of data such as read only memory (ROM), programmableread only memory (PROM), and/or memory cards.

[0023] Other types of database memory may include semiconductor,magnetic, optical, or storage media. The storage media memory caninclude hard disk drives, floppy disk drives, optical drives, removablesolid-state memory cards, or any other type of storage media. Thestorage media may be fixed or removable from a database system.

[0024] The master database (101) and the local databases (105-106) arecoupled through a background synchronization block (110). As describedsubsequently, the background synchronization block (110) provides amethod by which the local databases (105-106) are updated with data fromthe master database (101).

[0025] In one embodiment of the present invention, the objects stored onthe local databases each have a flag that indicates a synchronized ornot synchronized status of the object. In one embodiment, the flagindicates either “pending” or “ready”.

[0026] The “pending” flag indicates that the object has not beensynchronized with the master database and, therefore, may not beaccurate and up-to-date. The “ready” flag indicates that the object hasalready been successfully synchronized with the master database.

[0027] In one embodiment, the “pending” and “ready” flag takes the formof a single bit of data. For example, if the flag is a logic 0, the flagis set for “pending”. If the flag is a logic 1, the flag is set for“ready”. Other embodiments may use other flags to indicate the “pending”and “ready” states.

[0028] The “pending” and “ready” states are for illustration purposesonly. Alternate embodiments may use other states that performsubstantially the same function as the states of the present invention.For example, in one embodiment, a “pending” flag is set by a bit set toa logical 1. If that bit is not present, then the object has beensynchronized and is considered “ready” for processing.

[0029]FIG. 2 illustrates a flow diagram of one embodiment of a resourcesharing system of the present invention. In this embodiment, the systemhas a high priority process (201), a medium priority process (203), anda low priority process (205). Additionally, a resource locking token(200) is passed by the operating system among the various processes ofthe system.

[0030] The various processes (201, 203, and 205) of the embodiment ofFIG. 2 can be any application being executed by a system controllerand/or a local controller. In an embodiment where a data port is theshared resource, a high priority process may be a communicationsub-routine that scans for input data from a modem. A medium priorityprocess may be an application that outputs data through the data port. Alow priority process may be an application that scans the data port forcommunication line statistics and outputs to the data port statisticsfrom a local database.

[0031] The above-described processes are for illustration purposes only.There may be any number of processes that can take the form of anyprocess/application that is executable by a controller. Additionally,while the low priority process is illustrated as accessing a localdatabase, alternate embodiments have other priority processes accessingthe local database.

[0032] The resource locking token (200) may take the form of a binarysemaphore or some other type of token. In one embodiment, the token(200) is controlled by the operating system. The operating systemdetermines the priority of each process (201, 203, and 205) and passesthe token to a particular process based on that priority. The higherpriority processes receive the token before the lower priorityprocesses.

[0033] Once a particular process has the token, other processes arelocked out from accessing the resource. When the process is finishedwith the resource, the token is passed back to the operating system inorder to be passed to another process.

[0034] The token passing may be accomplished in various ways. In oneembodiment, the operating system assigns a portion (e.g., a bit) of amemory cache to each process for one particular resource. When the bitfor a particular process is set, that process now has access to theresource to the exclusion of the other processes. Once that bit has beenreset and the bit for another process has been set, the token has beenpassed to that process and it now has exclusive use of the resource.

[0035] This token passing process is for illustration purposes only.Alternate embodiments accomplish the token passing in other ways.

[0036]FIG. 3 illustrates a state diagram of one embodiment of a resourcesharing and database synchronization method of the present invention.The method of FIG. 3 is initiated only when the initiating process hasthe token.

[0037] In the subsequently discussed embodiment, the resource sharingand database synchronization method is initiated from the low priorityprocess (205) of the embodiment of FIG. 2. Alternate embodimentsinitiate the resource sharing and database synchronization method fromother priority processes.

[0038] The token sharing method is initiated by the low priority processat state A (301) where a request to synchronize a local database with amaster database is requested (303). One embodiment of a backgroundsynchronization method of the present invention is illustrated in FIG. 4and discussed subsequently.

[0039] The method then goes to state B (307) where it is determined ifthe background synchronization of the local database has been completed(309). If the synchronization has not been completed, the process exitsand the low priority process returns the token (315) for use by anotherhigher priority process.

[0040] If the synchronization process has been completed, the processreads and processes the data from the local database (311). The type ofprocessing performed depends on the function performed by the lowpriority process that is accessing the local database. In oneembodiment, the low priority process is responsible for tracking errorstatistics of a communication link.

[0041] The low priority process then accesses the shared resource thatis locked (313) to other processes. If the shared resource is a dataport, as discussed above, the low priority process accesses the dataport (313) in order to transmit data from the local database through themodem or other device coupled to the data port.

[0042] The method then returns to state A (301) where the entire methodis repeated. For example, the database synchronization is requested(303), a check for synchronization is done (309), and the token isreturned (315) for use by the next process.

[0043]FIG. 4 illustrates a flowchart of one embodiment of a backgroundsynchronization method of the present invention. The process that hasthe token and, therefore, access to the shared resource initiates thismethod.

[0044] In one embodiment, the local databases start off empty and thesynchronization method loads the requested objects into the requestinglocal database memory. In another embodiment, the local databasesalready have objects in memory that are overwritten by objects requestedfrom the master database.

[0045] While the subsequently described method refers to one localdatabase, the same method may apply to each of the 1−N local databases.One local database is used for illustration purposes only.

[0046] The status flags of any of the local database objects are set to“pending” (401). A request is made for synchronization of the localdatabase with the master database (405).

[0047] In one embodiment, in the request for synchronization (405), therequest is to synchronize the entire local database or only a desiredgroup of objects. For example, the group of objects to be synchronizedmay include only the bit error rate and the down time and not the otherobjects stored in either the master or local databases.

[0048] In one embodiment, the objects to be synchronized are downloadedfrom the master database to the local database. These downloaded objectsthen replace the older objects in the local database.

[0049] In another embodiment, the objects to be synchronized areoperated on by a process that determines whether the local databaseobjects are more recent or whether the master database objects are morerecent. If the local objects are the most recent, these objectsoverwrite the objects in the master database. If the master databaseobjects are more recent, the objects from the master database overwritethe older objects in the local database. If the objects to besynchronized are not already present in the other database, they arewritten to that database.

[0050] The local database, in one embodiment, requests synchronizationusing a request command from a card controller that is transmitted overa data bus. Such a configuration is discussed subsequently withreference to FIG. 5.

[0051] As the objects are transferred to the local database, theirassociated status flags are changed (407) to “ready” or some equivalentindication. The status flag of the last object in the group of objectsto be synchronized is checked (410). If the status flag is “pending”(415), read access to the local database is blocked (416) so thatobjects that have not been synchronized cannot be read and processed.

[0052] In one embodiment, this blocking is accomplished by a memory readsubroutine not permitting access until the last object has a “ready”flag. Other techniques, that are well known in the art, may be used toblock access to the memory until the database is synchronized. Thepresent invention is not limited to any one technique. The method thenreturns (425) to the database access method that initiated the requestfor synchronization.

[0053] In an alternate embodiment, each of the status flags of eachsynchronized object is checked. If any of the objects to be synchronizedstill has a “pending” flag set, access to the local database is blockedand the method returns to the initiating method.

[0054] With the synchronization method of the present invention, acontroller running various processes is not tied up waiting for thesynchronization method to be completed. only periodic checking isrequired to determine the status of the synchronization.

[0055] If the status flag of the last object, or all the objects, in thegroup is checked and found to be set to “ready” (415), the objects inthe local database are read and processed as required (420).

[0056]FIG. 5 illustrates a-block diagram of a typical communicationsystem in accordance with the background synchronization method of thepresent invention. The system of FIG. 5 is for illustration purposesonly and does not limit the synchronization method to this particulartype of system.

[0057] This system includes a management card (500) that is responsiblefor controlling the system of the present invention. In one embodiment,the master database is maintained on the management card (500) or othertype of controller card. One embodiment of the management card (500) isdescribed subsequently with reference to FIG. 6.

[0058] Line cards 1−N (501-503) are coupled to the management card (500)through a multi-drop bus or backplane (504). In the communication systemembodiment, line cards 1−N (501-503) are modems that support dataservices that are provided to customers. The local databases of thepresent invention are maintained on the line cards. In one embodiment,the resource sharing and database synchronization is performed on eachline card (501-503).

[0059] Each line card (501-503) is coupled to a communication link(521-523 respectively). The communication link may be a T1 line, a DSLline, a wireless link, or any other form of communication link dependingon the type of data services provided by each line card. Thecommunication system of the present invention is not limited to any oneform of communication link.

[0060] The communication links (521-523) couple their respective linecard to a remote line card (505-507) that is located at the customer'ssite. Remote line cards 1−N (505-507) are the same type of modem as therespective line card to which it is coupled. In other words, if linecard 1 (501) is a DSL modem, remote terminal 1 (505) is a DSL modem.

[0061] In one embodiment, a remote user computer (510) is coupled to theremote line cards (505-507). The remote user computer (510) can thencommunicate over its communication link (521) with the network to whichthe system is connected.

[0062] In one embodiment, a local user computer (515) is coupled to oneor more of line cards 1−N (501-503). The local user computer (515)enables a computer operator to interface with the system for maintenanceand operation of the system. Both a local user computer (515) and aremote user computer (510) can access their respective local databasesto which they are coupled. The local and remote user computers can theninitiate the background synchronization method of the present invention.

[0063] The system of the present invention is not limited to acommunication system as illustrated in FIG. 5. Any system that canexecute an embodiment of the resource sharing and databasesynchronization method are encompassed by the present invention.

[0064]FIG. 6 illustrates a block diagram of one embodiment of amanagement card of the present invention. In this embodiment, themanagement card has a controller (601) that controls the operation ofthe management card as well as the operation of the communicationsystem. The controller (601) may be a microprocessor, a microcontroller,or some other form of control circuitry.

[0065] In one embodiment, the controller (601) of the management cardexecutes an embodiment of the resource sharing and databasesynchronization method. In such an embodiment, the management cardcontroller (601) is responsible for passing the token that controlsaccess to the shared resource.

[0066] Memory (603) is coupled to the controller (601) to store data foruse by the controller (601). The memory (603) might be any of the typesdescribed above as the database memory. In this embodiment, the memory(603) stores the master database of the present invention.

[0067] Input/Output (I/O) connections (605) enable the controller (601)to communicate with the other cards of the system. The I/O connections(605) might include circuit card contacts such as connectors, circuitcard fingers, or other types of connections.

[0068]FIG. 7 illustrates a block diagram of one embodiment of a linecard of the present invention. In this embodiment, the line card has alocal controller (701) that controls the operation of the line cardcommunication circuitry. The controller (701) may be a microprocessor, amicrocontroller, or some other form of control circuitry.

[0069] In one embodiment, the local controller (701) is responsible forpassing the token that controls access to the shared resource.

[0070] Memory (703) is coupled to the controller (701) to store data foruse by the controller (701). The memory (703) might be any of the typesdescribed above as the database memory. In this embodiment, the memory(703) stores the local database(s) of the present invention.

[0071] Input/Output (I/O) connections (705) enable the line card tocommunicate with the management card as well as other cards of thesystem. In one embodiment, the I/O connections (705) include circuitcard contacts such as connectors, circuit card fingers, or other typesof connections.

[0072] Modem function circuitry (707) provides the line card with theability to communicate over communication links with other modems. Modemoperation is well known in the art and is not discussed further. Themodem function circuitry (707) is coupled to the controller (701) andenables the local communication system to communicate over thecommunication links with remote modems that are coupled to computers.

[0073] In summary, the embodiments of the resource sharing and databasesynchronization of the present invention provide a system that has ashared resource with the ability to minimize the time that higherpriority processes are locked out of the resource. Therefore, highpriority and critical processes/applications are less likely to becomesuspended. Additionally, since system resources can be shared, systemefficiency increases.

[0074] Numerous modifications and variations of the present inventionare possible in light of the above teachings. It is therefore to beunderstood that within the scope of the appended claims, the inventionmay be practiced otherwise than as specifically described herein.

What is claimed is:
 1. A method for resource sharing and databasesynchronization, the method comprising: receiving exclusive access tothe resource; requesting updating of a local database after exclusiveaccess to the resource is received; reading data from the local databasewhen the synchronization is complete and exclusive access is received;and accessing the resource with the data.
 2. The method of claim 1 andfurther including releasing exclusive access to the resource.
 3. Themethod of claim 1 wherein updating the local database comprisessynchronizing the local database with a master database.
 4. The methodof claim 1 wherein exclusive access to the resource is received by atoken.
 5. The method of claim 1 wherein the resource includes a dataport, a modem, memory, a software application, or a processor.
 6. Themethod of claim 1 and further including: accessing the resource inresponse to the data read from the local database; and releasingexclusive access of the resource.
 7. A method for resource sharing anddatabase synchronization in a system comprising at least one sharedsystem resource, a master database, and a local database, the methodcomprising: receiving a token that grants exclusive access to the atleast one system resource; requesting synchronization of the localdatabase with the master database; determining if the synchronizationhas been completed; reading data from the local database after thesynchronization has been completed; and accessing the at least oneshared resource with the data.
 8. The method of claim 7 and furtherincluding returning the token to an operating system that controlsdistribution of the token.
 9. The method of claim 7 wherein requestingsynchronization includes updating the local database with data that issubstantially equivalent to the master database.
 10. The method of claim7 wherein requesting synchronization includes updating the localdatabase with data that is a subset of the master database.
 11. A systemfor resource sharing and database synchronization, the systemcomprising: a shared system resource; a local database comprising afirst set of data; a master database comprising a second set of data; asystem controller that grants exclusive access to the shared systemresource; and a local controller that accepts exclusive access to theshared resource, requests synchronization of the first set of data withthe second set of data after receiving exclusive access, reads localdata from the local database after synchronization, accesses the sharedresource with the local data, and relinquishes exclusive access to theshared resource.
 12. The system of claim 11 wherein the second set ofdata is a subset of the first set of data.
 13. The system of claim 11wherein the first set of data and the second set of data aresubstantially equivalent.
 14. A modem card that operates in a systemhaving a shared system resource, the modem card comprising: modemfunction circuitry that transmits and receives data over a communicationlink; memory that stores a local database comprising a first set ofdata; and a controller that controls the modem card such that exclusiveuse of the shared system resource is received, a request to synchronizethe first set of data to a second set of data is made after receivingexclusive use of the shared system resource, reading at least a subsetof the first set of data after synchronization is complete, andaccessing the shared system resource with the subset of the first set ofdata.
 15. The modem card of claim 14 wherein the exclusive use of theshared system resource is received as a token from the system'soperating system.
 16. A modem card that operates in a system having ashared system resource and an operating system that passes a resourcelocking token, the modem card comprising: modem function circuitry thattransmits and receives data over a communication link; memory thatstores a local database comprising a first set of data; and a controllerthat controls the modem card such that the resource locking token isreceived, a request to synchronize the first set of data to a second setof data is generated after receiving the resource locking token, readinga subset of the first set of data after synchronization is complete,accessing the shared system resource with the subset of the first set ofdata, and returning the resource locking token to the operating system.17. A system for resource sharing and database synchronization, thesystem comprising: a plurality of application processes, each processhaving an assigned priority level and sharing a resource locking token,at least one process having a low priority level; an operating systemthat controls distribution of the resource locking token among theplurality of processes, the resource locking token being passed to afirst process of the plurality of processes in response to the assignedpriority level; a local database that is synchronizable with a masterdatabase; and a local controller capable of executing the plurality ofapplication processes such that the low priority process receives theresource locking token, requests synchronization of the local databaseafter receiving the resource locking token, accesses the local databaseafter synchronization is complete, accesses the resource in response todata from the local database, and returns the token to the operatingsystem.
 18. A method for resource sharing and database synchronizationin a system comprising a plurality of shared system resources, a masterdatabase, and a plurality of local databases, the method comprising:receiving a resource locking token that grants exclusive access to afirst system resource of the plurality of shared system resources, theresource locking token received from an operating system; afterreceiving the resource locking token, requesting synchronization of thelocal database with the master database; determining if thesynchronization is complete; reading data from the local database afterthe synchronization has been completed; accessing the at least oneshared resource with the local data; and returning the resource lockingtoken to the operating system.
 19. A communication system comprising: aplurality of shared system resources; a system controller comprising: acontroller capable of controlling predetermined operations of thecommunication system including executing an operating system; andmemory, coupled to the controller, that stores a master database; and aplurality of modem cards, each modem card comprising: modem functioncircuitry that transmits and receives data between the communicationsystem and remote users; memory that stores a local database; and acontroller that receives a resource locking token that enables exclusiveaccess to a first shared resource of the plurality of shared resources,generates a request to synchronize the local database to master databaseafter receiving the resource locking token, reads a subset of the localdatabase after synchronization is complete, accesses the first sharedresource with the subset of the first set of data, and returns theresource locking token to the operating system.
 20. The system of claim19 wherein the resource locking token is a binary semaphore.
 21. Asystem for resource sharing and database synchronization, the systemcomprising: a shared system resource; a local database comprising alocal set of data; and a local controller that executes a process thatis granted exclusive access to the shared resource, requestssynchronization of the local set of data with a master set of data afterexclusive access is granted, reads the local database aftersynchronization, accesses the shared resource with the local set ofdata, and relinquishes exclusive access to the shared resource.
 22. Amodem card that operates in a system having a shared system resource,the modem card comprising: modem function circuitry that transmits andreceives data over a communication link; memory that stores a localdatabase comprising local data; and a controller that executes aplurality of processes wherein one process receives exclusive use of theshared system resource is received, requests synchronization of thelocal data to a master database after receiving exclusive use of theshared system resource, reads at least a subset of the local data aftersynchronization is complete, and accesses the shared system resourcewith the subset of the local data.